<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">配置分组</label>
        <div class="layui-input-block">
            {foreach $tab_list as $key=>$tab}
            <input name="group" value="{$tab.name}" title="{$tab.title}" {eq name='tab.name' value='$vo.group|default=0'}checked=""{/eq} type="radio">
            {/foreach}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置类型</label>
        <div class="layui-input-inline">
            <select name="type" lay-verify="required" lay-search="">
                <option value="">请选择一项</option>
                {foreach $type_list as $key=>$type}
                {eq name='type.name' value='$vo.type|default=0'}
                <option selected value="{$type.name}">{$type.title}</option>
                {else/}
                <option value="{$type.name}">{$type.title}</option>
                {/eq}
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" value='{$vo.title|default=""}' required="required" lay-verify="title" title="请输入配置标题" placeholder="请输入配置标题" class="layui-input">
            <p class="help-block">一般由中文组成，仅用于显示</p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" value='{$vo.name|default=""}' required="required" title="请输入配置名称" placeholder="请输入配置名称" class="layui-input">
            <p class="help-block">由英文字母和下划线组成，如 <code>web_site_title</code>，调用方法：<code>config('web_site_title')</code></p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置值</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入配置值" title="请输入配置值" class="layui-textarea" name="value">{$vo.value|default=""}</textarea>
            <p class="help-block">该配置的具体内容</p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置项</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入配置项" title="请输入配置项" class="layui-textarea" name="options">{$vo.options|default=""}</textarea>
            <p class="help-block">用于单选、多选、下拉、联动等类型</p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">配置说明</label>
        <div class="layui-input-block">
            <input type="text" name="tips" value="{$vo.tips|default=''}" title="请输入配置说明" placeholder="请输入配置说明" class="layui-input">
            <p class="help-block">该配置的具体说明</p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input name="status" value="1" title="启用" checked="" type="radio">
            <input name="status" value="0" title="禁用" type="radio">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort" value='{$vo.sort|default="100"}' lay-verify="sort" title="请输入排序编号" placeholder="请输入排序编号" class="layui-input">
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

    <script>window.form.render();</script>
</form>
